package com.jjwxc.jwjskandriod.my.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.jjwxc.jwjskandriod.my.fragment.DecorationFragment
import com.jjwxc.jwjskandriod.my.fragment.PortraitFragment

class SelectAvatarAdapter(private val fm: FragmentManager) : FragmentPagerAdapter(fm) {

    override fun getItem(i: Int): Fragment {
        var fragment: Fragment? = null
        when (i) {
            0 -> fragment = PortraitFragment()
            1 -> fragment = DecorationFragment()
        }
        return fragment!!
    }

    override fun getCount(): Int {
        return 2
    }

}